home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / fortune-.tar / fortune- / fortune / util / README.ansify < prev    next >
Text File  |  1995-10-19  |  4KB  |  64 lines

  1. NOTA BENE:
  2.   This is an abandoned program; on reflection, it attempts to solve the
  3.   problem in the wrong way.  Instead, I'm going to enhance fortune, using
  4.   termcap or terminfo links.  In order to get this (working) fortune out as
  5.   soon as possible, though, I'm releasing it now, without terminal
  6.   enhancements (interesting way to put it, huh?).  So this is dead code,
  7.   ignore it; it's here so I can look at it when I enhance fortune itself.
  8.  
  9. Umm.  ansify may or may not be a finished program when this distribution
  10. goes out.  If 'make ansify' works from the top-level directory, then I've
  11. hacked it enough for minimal functionality.  If not, not.  If there isn't
  12. a target, the code is probably incomplete; I don't write code from
  13. beginning to end, straight through.
  14.  
  15. What it does: well, maybe nothing.
  16.  
  17. On the other hand, if it does something, what it should be doing is
  18. reading a text file and looking for the character ^H (control-H, ascii
  19. 0x08, the 'backspace' character).  On most terminals, printing a
  20. character, ^H, and another character results in the terminal backing up
  21. and overstriking.  Fancy terminals can do underlines this way, if the
  22. character set is 'transparent'.  Most can't, so it's just extra dreck in
  23. the text file.  So, what ansify does, is tries to figure out which of a
  24. limited number of uses the ^H is being put to (double-striking, which
  25. makes bold characters, underlining, and accented characters), and then
  26. replaces that with a VT100 control sequence that does the same thing.
  27.  
  28. Of course, a text file containing VT100 control sequences isn't going to
  29. look like much on a terminal that doesn't understand VT100 control
  30. sequences, so if your terminal doesn't understand such sequences, there
  31. are two possible solutions: 1) don't use ansify, and 2) wait for the
  32. version that reads a configuration file.  The configuration file will
  33. permit you to establish arbitrary control sequence strings for bold and
  34. underline (and maybe for normal text, I dunno); the next stage of upgrade
  35. will be to also permit definition of certain accented characters (so that
  36. '^He will display as e-acute).  That last stage is problematic, since
  37. character sets can differ on the same computer, as for instance the
  38. built-in character set for text mode versus the fonts used in an xterm.
  39. So the configuration file really *should* be able to distinguish between
  40. terminal types.  But don't count on it.
  41.  
  42. The reason that this is included here is because I want to have it to run
  43. on my personal fortunes databases, so that fortunes actually have a way
  44. of emphasizing words.  But it isn't very important, so I'm hacking it
  45. rather idly (and I'm not really a top-notch programmer, so there may be
  46. some really ugly code in there (q.v. the fortune: "This algorithm is
  47. really nasty.  You might want to mug somebody with it.")).  The
  48. distributed databases will use the traditional format.
  49.  
  50. Come to think of it, there ought to be a de-ansify, too.  Worry about
  51. that later.
  52.  
  53. As of Columbus Day 1995, it compiles.  I've no idea whether it works or
  54. not at this point, but it does compile cleanly (I'm putting most of my
  55. energy into getting a working fortune/strfile/unstr with cleaned-up
  56. databases together, so I haven't done much except to write the
  57. skeleton--if the thing actually works, I'll be very, very surprised).
  58. That it compiles doesn't prove anything except that the syntax is
  59. correct; if you try to run this, I'd suggest that you watch it closely,
  60. and not rely on it to produce anything useful.  (If I ever get it in
  61. working order, I'll change this README).
  62.  
  63. Amy A. Lewis    alewis@email.unc.edu    October 1995
  64.